package com.ibeeking.found.cms.service.common.constants.enums;

import com.ibeeking.nematos.utils.data.StringUtils;

/**
 * @Author ibeeking
 * @Date: 2021-01-05 19:15
 * @Description: PagePublishStatusEnum
 */
public enum PagePublishStatusEnum {
    /**
     * 0未发布 1已发布 2定时发布
     */
    NO(0, "未发布"),
    /**
     * 1已发布
     */
    YES(1, "已发布"),
    /**
     * 定时发布
     */
    TIMING(2, "定时发布"),;
    private Integer value;
    private String name;

    PagePublishStatusEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getName(Integer value) {
        for (PagePublishStatusEnum enumObj : values()) {
            if (enumObj.getValue().equals(value)) {
                return enumObj.name;
            }
        }
        return StringUtils.EMPTY;
    }

    public static PagePublishStatusEnum getEnum(Integer value) {
        for (PagePublishStatusEnum enumObj : values()) {
            if (enumObj.getValue().equals(value)) {
                return enumObj;
            }
        }
        return null;
    }
}
